<template>
  <div class="welcome">
    <template>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item><a href="/">管理首页</a></el-breadcrumb-item>
      </el-breadcrumb>
    </template>
    <template>
      <el-table
        :data="tableData"
        style="width: 100%"
        :default-sort="{ prop: 'date', order: 'descending' }"
      >
        <el-table-column
          prop="username"
          label="登录账户"
          width="180"
        ></el-table-column>
        <el-table-column
          prop="last_ip"
          label="上次登入ip"
          width="180"
        ></el-table-column>
        <el-table-column
          prop="last_time"
          label="上次登入时间"
          sortable
          :formatter="formatter"
        ></el-table-column>
        <el-table-column
          prop="now_ip"
          label="本次登入ip"
          width="180"
        ></el-table-column>
        <el-table-column
          prop="now_time"
          label="本次登入时间"
          width="180"
        ></el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          username: "lbw",
          last_ip: "175.27.248.9",
          last_time: "2022/02/02 22:33:31",
          now_ip: "175.27.248.9",
          now_time: "2022/10/19 22:33:31",
        },
        {
          username: "lbw",
          last_ip: "175.27.248.9",
          last_time: "2022/02/02 22:33:31",
          now_ip: "175.27.248.9",
          now_time: "2022/10/19 22:33:31",
        },
        {
          username: "lbw",
          last_ip: "175.27.248.9",
          last_time: "2022/02/02 22:33:31",
          now_ip: "175.27.248.9",
          now_time: "2022/10/19 22:33:31",
        },
        {
          username: "lbw",
          last_ip: "175.27.248.9",
          last_time: "2022/02/02 22:33:31",
          now_ip: "175.27.248.9",
          now_time: "2022/10/19 22:33:31",
        },
      ],
    };
  },
  methods: {
    formatter(row, column) {
      return row.last_time;
    },
  },
};
</script>

<style></style>
